home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / blkwrite.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  68 lines

  1. #include "blkwrite.h"
  2.  
  3. BlockWrite::BlockWrite(rect coord, char* fname, char* fileName,
  4.         char* h, int s, int res, BORDERS b_type, BORDERS write_border,
  5.         BORDERS hdr_b_type, int pat, int write_pat, int hdr_pat,
  6.         int elem_pat)
  7.     : Block(coord, fname, h, s, res, b_type, hdr_b_type, pat, hdr_pat,
  8.             elem_pat)
  9.     {
  10.     rect r = textRect(w1->bound());
  11.     r.origin.Y += 2;
  12.     r.corner.Y -= (1 + textY(s));
  13.     r.origin.X += 3;
  14.     r.corner.X -= (3 + textX(s));
  15.  
  16.     write = new Write(r, fileName, /*fName*/ "", /*h*/ "",
  17.            /* s */ 0, write_border, NO_BORDER,
  18.            write_pat, /*hdr_pat*/ 0);
  19.     write->set_ret(1);
  20.     insert(write, 1);
  21.  
  22.     assign(write, left_element, AC_LEFT);
  23.     assign(write, right_element, AC_RIGHT);
  24.     assign(write, up_element, AC_UP);
  25.     assign(write, dn_element, AC_DOWN);
  26.     assign(write, cancel_element, AC_CANCEL);
  27.     assign(write, pg_up_element, AC_PG_UP);
  28.     assign(write, pg_dn_element, AC_PG_DN);
  29.     }
  30. /////////////////////////
  31. void BlockWrite::rearrange()
  32.     {
  33.     Block::rearrange();
  34.     rect r = textRect(w1->bound());
  35.     int s = w1->get_shadow();
  36.     r.origin.Y += 2;
  37.     r.corner.Y -= (1 + textY(s));
  38.     r.origin.X += 3;
  39.     r.corner.X -= (3 + textX(s));
  40.     write->repose(r);
  41.     }
  42. /////////////////////////
  43. void BlockWrite::hide()
  44.     {
  45.     write->hide();
  46.     w1->hide();
  47.     }
  48. ///////////////////////////
  49. /*
  50. void main()
  51.     {
  52.     if(!init_KNOW_HOW())
  53.         return;
  54.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  55.     bar(0, 0, getmaxx(), getmaxy());
  56.  
  57.     BlockWrite s(rect(10, 0, 60, 24), "window.pcy", "work.txt",
  58.         "EDITOR", 6, MOVE | RESIZE, SHOW_BORDER, SHOW_BORDER,
  59.         SHOW_BORDER, 0, 0, 0, 12);
  60.  
  61.     s.show_window();
  62.     s.exe();
  63.     s.hide();
  64.  
  65.     close_KNOW_HOW();
  66.     closegraph();
  67.     }
  68. */